package com.iot.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.iot.product.entity.Product;
import com.iot.product.mapper.ProductMapper;
import com.iot.product.service.ProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 产品表(包括网桥产品) 服务实现类
 * </p>
 *
 * @author 孟繁森
 * @since 2021-03-17
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {
    @Autowired
    private ProductMapper productMapper;

    @Override
    public IPage<Product> getProductList(Page<Product> page, Product product) {

        product.setDeleteStatus(0);

        if ( product.getDeleteStatus() != null ) product.setDeleteStatus(1);

        return (IPage<Product>) productMapper.getProductList(page, product);
    }
}
